const parsePositions = positions => {
  if (typeof positions === "string") {
    if (positions.indexOf("#") >= 0) {
      throw new Error("the positions invalid")
    }
    positions = positions.split(";").filter(item => !!item)
  }
  return positions.map(item => {
    return parsePosition(item)
  })
}

const arrayToString = arr => {
  const mappedArr = arr.map(subArray => subArray.join(","))
  const result = mappedArr.join(";") + ";"
  return result
}
export { parsePositions }
